import Vue from 'vue'
import Vuex from 'vuex'

//引入vuex持久化存储插件
import persistedstate from 'vuex-persistedstate'


Vue.use(Vuex);

import baseInfo from './modules/baseInfo.js'
import userInfo from './modules/userInfo.js'
const store = new Vuex.Store({
  // 
  modules: {
    m_baseInfo: baseInfo,
    m_userInfo: userInfo
  },
  plugins: [
    persistedstate({
      storage: {
        getItem: key => uni.getStorageSync(key),
        setItem: (key, value) => uni.setStorageSync(key, value),
        removeItem: key => uni.removeStorageSync(key)
      }
    })
  ]
})
export default store